﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.BLL;
using GCELibrary.Current;
using ZF.BLL.Page;

namespace ZF.WS.news
{
    public partial class FitupMaster : ZF.BLL.Page.MasterPage
    {

        [PageArgument(Key = "tid")]
        public int TypeId { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
           

            using (var dc = SiteInfo.CreateDBDataContext())
            {


                var isRecommendList = dc.SP_Merchandise.Where(p => p.IsRecommend && !p.IsDel).ToList().Select(p => new
                {
                    Merc = p,
                    Photo = p.FirstPhoto,
                }).Take(2).ToList();
                this.lvIsRecommend.DataSource = isRecommendList;
                this.lvIsRecommend.DataBind();

                this.lvFitup.DataSource = dc.I_Fitup.Where(p => p.TypeId == TypeId).OrderByDescending(p => p.AddTime).Take(10).ToList();
                this.lvFitup.DataBind();
            }

        }
    }
}
